﻿using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;

using Whoever.Health.Business.Entities;

namespace Whoever.Health.DataAccess.Configuration
{
    internal class ProfileConfiguration : EntityTypeConfiguration<Profile>
    {
        public ProfileConfiguration()
        {
            HasKey(e => e.Id);

            Property(e => e.Id)
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            Property(e => e.Name)
                .HasMaxLength(60)
                .IsUnicode(false);

            Property(e => e.Surname)
                .HasMaxLength(60)
                .IsUnicode(false);

            Property(e => e.ImageUrl)
                .HasMaxLength(60)
                .IsUnicode(false);

            Property(e => e.TelphoneNumber)
                .HasMaxLength(30)
                .IsUnicode(false);

            Property(e => e.CellularNumber)
                .HasMaxLength(30)
                .IsUnicode(false);

            Property(e => e.JobName)
                .HasMaxLength(60)
                .IsUnicode(false);

            Property(e => e.JobDescription)
                .IsUnicode(false);

            ToTable("Profile", "dbo");
        }
    }
}
